Aleksey Pershin's profile

Lava Lamp Simulation + Breakdown

Lava lamp is a personal project I've wanted to do since SideFX implemented fluids in vellum.
Breakdown
1) raw sim. 2) secondary sim. 3) meshed vdb. 4) tiny advected particles. 5) render.
It's not supposed to be a step-by-step tutorial. I'll just show some of my techniques and solutions to problems I faced. 
Of course, any project I start with some research. Below, I explain how this stuff works.
The main task was to ensure that the rising bubbles did not mix. In terms of Vellum, each bubble has to have a different i@phase attribute. Then, when bubbles cooled and sank, they had to have a definite i@phase to mix them into one piece again.
1. I modelled a shape of glass part and made fluid particles from this.
2. Added initial temperature for speed up preroll. 
On the left you can see visualization of the @temperature attribute. ​​​​​​​
Floating and sinking are driven by @temperature like his:
force = set(0, @temperature, 0);
How I calculate @temperature, nothing special just fitted @P.y
Surface tension is also driven by @P.y. I found values using wedges, which I will explain below.
By the way, these YouTube 10-hour lava lamp videos with relaxing music accompanied me throughout this project on my second monitor.
Then how I detected detached bubbles.
After the main logic is done, it's time to achieve a realistic look. And that's when it's time for wedges. 
They saved me a lot of time because I just started 384 (8x8x6 parameters) simulations before going to bed, and in the morning, I had everything ready. This is how I work with wedges:
​​​​​​​Then I created 3 parameters in the fileSOP, in my case, that will form the folder name for me, such as "2_1_1". This way, I can quickly change the folder name and observe how each parameter independently affects the look. 
Additionally, you need to clear all attributes for disk space economy and add values of your wedges to the detail so you will know the exact number needed in your parameters.
​​​​​​​But even after trying various parameters, my bubbles quickly took the shape of a sphere. I needed a more liquid, squishier form with more inertia. I think it's possible with a smaller particle size, but it would take a long time. 
So I decided to make a secondary postprocess simulation. It's the second one in the video below the breakdown section begins. I used a softpin constraint with Increasing Stiffness Dropoff and a value of 0.2. 
Additionally, to stabilize particles and avoid jittering, I used the forbidden Jedi technique - filtering position with chops. However, be aware that if you have changed the particle count or your cache doesn't cover the entire length of the timeline.​​​​​​​

That's all I wanted to show. I hope you like it and find something useful for you. If you have any questions, feel free to ask.

Lava Lamp Simulation + Breakdown
Published:

Owner

Lava Lamp Simulation + Breakdown

Published: